package com.aaa.service.impl;

import com.aaa.dao.ZcglPubliclandsDao;
import com.aaa.entity.ZcglPublic;
import com.aaa.entity.ZcglPubliclands;
import com.aaa.service.ZcglPubliclandsService;
import com.aaa.util.Result;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * (ZcglPubliclands)表服务实现类
 *
 * @author makejava
 * @since 2021-01-19 16:52:00
 */
@Service("zcglPubliclandsService")
public class ZcglPubliclandsServiceImpl extends ServiceImpl<ZcglPubliclandsDao, ZcglPubliclands> implements ZcglPubliclandsService {

    @Autowired
    private ZcglPubliclandsDao dao;

    @Override
    public Result listAll() {
        List<ZcglPubliclands> list = dao.selectList(null);
        if (list!=null){
            return new Result(1003,"hjghj",list);
        }
        return null;
    }

    @Override
    public List<ZcglPubliclands> listPage(long count , long size) {
        List<ZcglPubliclands> selectPage = dao.listPage(count,size);
        return selectPage;
    }
    /**
     * create by: Student洋
     * description: 查询单条全部数据
     */
    @Override
    public List<ZcglPublic> selectOne(String assetNumber) {
        List<ZcglPublic> list = dao.selectOneByAsset(assetNumber);
        return list;
    }
    /**
     * create by: Student洋
     * description: 逻辑删除，修改当前列的状态码
     */
    @Override
    public boolean delete(String assetNumber) {
        boolean del =dao.delByassetNumber(assetNumber);
        return del;
    }
/**
 * create by: Student洋
 * description: 向共有土地信息表中添加数据
 */

    @Override
    public int addPublic(ZcglPublic add) {
        int a = dao.addPublic(add);
        return a;
    }
/**
 * create by: Student洋
 * description: 向拆分的公共表中添加数据
 */
    @Override
    public int addHouse(ZcglPublic add) {
        int b = dao.House(add);
        return b;
    }


}